Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add optional maxDistance to raycast #2012

Merged
merged 24 commits into from
Oct 7, 2022
Merged

feat: Add optional maxDistance to raycast #2012

merged 24 commits into from
Oct 7, 2022

Conversation

ufrshubham
Copy link
Member

@ufrshubham ufrshubham commented Oct 4, 2022

Description

This PR adds an optional parameter to raycast API called maxDistance. Using this parameter users can control the limit within which raycast scans for hits.

Demo of added example:
Raycast-maxDistance

Checklist

  • The title of my PR starts with a [Conventional Commit] prefix (fix:, feat:, docs: etc).
  • I have followed the [Contributor Guide] when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #2011

@ufrshubham ufrshubham marked this pull request as ready for review October 4, 2022 12:39
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, in the future when the raycasting uses a broadphase this could lower the search space by a lot.

doc/flame/collision_detection.md Outdated Show resolved Hide resolved
packages/flame/lib/src/collisions/collision_detection.dart Outdated Show resolved Hide resolved
@spydon spydon requested a review from a team October 4, 2022 14:50
@spydon spydon requested a review from a team October 4, 2022 15:36
Copy link
Member

@erickzanardo erickzanardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits, but looks good to me!

ufrshubham and others added 3 commits October 7, 2022 17:26
Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Erick <erickzanardoo@gmail.com>
@spydon spydon merged commit 6b78b10 into flame-engine:main Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add scan distance input for raycast
4 participants